home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Aug 90 / MacApp.Tech$ 8⁄31⁄90 / 1817-Re[2] Multiple Inher-Aug90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.7 KB  |  54 lines  |  [TEXT/GEOL]

  1. Item    0269247                         24-Aug-90        18:13PDT
  2.  
  3. From:   D3932                           Ritchie, Clifford,PRT
  4.  
  5. To:     ROSENSTEIN1                     Rosenstein, Larry
  6.  
  7. cc:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    Re: Re: Multiple Inheritance
  10.  
  11. Being an Eiffel user, I must set the record straight for Mr. Rosenstein.
  12.  
  13. The Eiffel class library contains three classes related to stacks: STACK,
  14. FIXED_STACK, and LIST_STACK. STACK is a deferred class (abstract) which
  15. describes the notion of a stack without commitment to its particular underlying
  16. representation. FIXED_STACK is a STACK represented as an ARRAY. And of course
  17. LIST_STACK implements stacks as linked lists.
  18.  
  19. In Eiffel we are not confined as to how the stack has to be represented.  If
  20. for example, say, I wanted a sorted stack: all I do is create a class
  21. SORTED_STACK, and make it inherit from STACK and SORTED_LIST. Voila!  A stack
  22. that's implemented as a sorted link list. Hey man, that's power! Try to do that
  23. in Object Pascal.  By the way, this is only an example, by definition, ordering
  24. a stack is not a stack. A stack must be LIFO or FIFO.
  25.  
  26. Just for fun, the actual inheritance of FIXED_STACK is:
  27.  
  28.   ARRAY[T]
  29.     INDEXABLE[T,INTEGER]
  30.     INDIRECT[T]
  31.     BASIC_ROUT
  32.   STACK[T]
  33.     DISPENSER[T]
  34.  
  35. The [T]'s stuff indicate a parameterized classes, which is how Eiffel
  36. implements the concept of genericity.
  37.  
  38. I don't understand why you say FIXED_STACK does not export any of ARRAY's
  39. features.  I count four of them being exported by ARRAY in the actual code.
  40. You don't want to export them all, otherwise you'll try to work with it as an
  41. array and not a stack.
  42.  
  43. I hope this makes things clearer.
  44.  
  45. Vive Eiffel!
  46. --Cliff
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.